const name = '图表'
import { EDITOR_TYPE } from '@/tools/constant';

export const setting = {
  type: EDITOR_TYPE[0],
  name,
  icon: 'chalkboard',
  id: '',
  options: {
    name,
    defaultType: 'String'
  },
  /**
   * 字定义设置属性面板, 默认
   * constant.js PANEL_DEFAULT
   */
  attrPanel: [{
    label: '数据属性',
    name: 'PanelData'
  }, {
    label: '图形属性',
    name: 'PanelChart'
  }],
  // 判断是否是刚拉入状态
  isBegin: true,
  // 图形类型
  graphType: '',
  // 支持图形类型
  supportTypes: [],
  // 数据源
  dataSource: {
    datasourceId:'',
    tableName:'',
    datasourceType:'',
    projectId:''
  },
  GRAPH_LIST:[
    {value:"card",name:"卡片",icon:"static/svg/card.svg", type: 'other'},
    {value:"text",name:"文本",icon:"static/svg/text.svg", type: 'other'},
    {value:"img",name:"图片",icon:"static/svg/img.svg", type: 'other'},
    {value:"table",name:"表格图",icon:"static/svg/table-map.svg", type: 'other'},
    {value:"line",name: "折线图",icon:"static/svg/line-chart.svg", type: 'chart'},
    {value:"line_area",name:"折线面积",icon:"static/svg/polyline-area.svg", type: 'chart'},
    {value:"gauge",name:"计量图",icon:"static/svg/metering-chart.svg", type: 'chart'},
    {value:"scatter",name:"散点图",icon:"static/svg/scatter-plot.svg", type: 'chart'},
    {value:"bar",name:"柱状图",icon:"static/svg/histogram.svg", type: 'chart'},
    {value:"bar_type",name:"条形图",icon:"static/svg/bar-chart.svg", type: 'chart'},
    {value:"funnel",name:"漏斗图",icon:"static/svg/funnel-chart.svg", type: 'chart'},
    {value:"pie",name:"饼图",icon:"static/svg/pie-chart.svg", type: 'chart'},
    {value:"map",name:"地图",icon:"static/svg/map.svg", type: 'chart'},
    {value:"pie_more",name:"环形图",icon:"static/svg/ring-diagram.svg", type: 'chart'},
    {value:"bar_pile",name:"柱状堆叠",icon:"static/svg/column-stacking.svg", type: 'chart'},
    {value:"bar_type_pile",name:"条形堆叠",icon:"static/svg/strip-stack.svg", type: 'chart'}
  ],
  // 图形属性
  graphOptions: {
    legend: {
      show: true,
      top: '34',
      textStyle: {
        color: '#333'
      }
    },
    tooltip: {},
    dataset: {},
    xAxis: [{
      type: 'category',
      show:true,
      onZeroAxisIndex :0,
      axisLine: {
        onZero: false,
        lineStyle: {
          width: 1,
          color: '#333',
          type: 'solid'
        }
      },
      splitLine: {
        show: false,
        lineStyle: {
          color: '#ddd',
          width: 1,
          type: 'solid'
        }
      },
      axisLabel :{
        rotate : '0',
        fontSize : '12',
      },
    }],
    yAxis: [{
      show: true,
      axisLine: {
        lineStyle: {
          width: 1,
          color: '#333',
          type: 'solid'
        }
      },
      splitLine: {
        show: false,
        lineStyle: {
          color: '#ddd',
          width: 1,
          type: 'solid'
        }
      },
      axisLabel :{
        rotate : '0',
        fontSize : '12',
      }
    }],
    series: [],
    title:{
      text: '',
      x: 'left',
      padding: [16, 20],
      textStyle: {
        color: '#333',
        fontSize: '14'
      }
    },
    others: {} // 用于非echart传数据
  }
}
